package com.ssy.lingxi.member.merchant.utils;

import com.ssy.lingxi.member.merchant.model.bo.ChannelAuthBO;

import java.util.ArrayList;
import java.util.List;

/**
 * ChannelAuthBO相关工具类
 * @author 万宁
 * @version 2.0.0
 * @date 2021-04-16
 */
public class ChannelAuthUtil {

    /**
     * 复制
     * @param authBO 被复制的实例
     * @return 新实例
     */
    public static ChannelAuthBO copy(ChannelAuthBO authBO) {
        ChannelAuthBO newAuthBO = new ChannelAuthBO();
        newAuthBO.setRelationId(authBO.getRelationId());
        newAuthBO.setMemberId(authBO.getMemberId());
        newAuthBO.setRoleId(authBO.getRoleId());
        return newAuthBO;
    }

    /**
     * 复制列表
     * @param authBOList 被复制的列表
     * @return 新列表
     */
    public static List<ChannelAuthBO> copy(List<ChannelAuthBO> authBOList) {
        List<ChannelAuthBO> resultList = new ArrayList<>();
        authBOList.forEach(authBO -> resultList.add(copy(authBO)));
        return resultList;
    }
}
